package server.client.controller;

import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @GetMapping("getUserId")
    public SaResult userId() {
        long userId = StpUtil.getLoginIdAsLong();
        return SaResult.ok().setData("hello client : " + userId);
    }

    @GetMapping("hello")
    public Object hello() {
        return "hello client";
    }

}
